#ifndef APIGUI_H
#define APIGUI_H

#include <QObject>
#include <QHostAddress>

class								Gui;

struct								connectInfo
{
	 QHostAddress					_ip;
	 quint16						_port;

	 connectInfo(const QHostAddress &ip, quint16 port) : _ip(ip), _port(port){}
};

class apiGui : public QObject
{
	Q_OBJECT

public:
	apiGui(Gui *gui, QObject *parent = 0);
	~apiGui();

private:
	Gui								*_gui;

private:
	void							initConnect();

public :
	const connectInfo 				getConnectInfo();

	void							displayMessage(const std::string &, const std::string &);
	void							addServer(quint16 id, QString &name);
	void							changeName(quint16 id, QString &name);
	void							removeServer(quint16 id);

public slots:
	void							handleConnect();
	void							handleMode(quint16, bool);
	void							handleConfig(quint16);

signals:
	void							newConnexion(const connectInfo);
	void							changeMode(quint16, bool);
	void							config(quint16);
};

#endif // APIGUI_H
